package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.Strategy;
import cn.wolfcode.trip.base.query.CollectQueryObject;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.query.StrategyQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface StrategyMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Strategy record);

    Strategy selectByPrimaryKey(Long id);

    List<Strategy> selectAll();

    int updateByPrimaryKey(Strategy record);

    List<Strategy> selectForList(QueryObject qo);

    List<Strategy> selectCommend(StrategyQueryObject qo);

    void deleteCollect(CollectQueryObject qo);

    void saveCollect(CollectQueryObject qo);

    Integer isCollect(@Param("userId") Long userId, @Param("strategyId") Long strategyId);

    Integer countCollect(@Param("strategyId") Long strategyId);

    List<Strategy> selectStrategyCollectByUserId(@Param("userId") Long userId);

    List<Map<String,Object>> selectStrategyByKeyword(@Param("keyword") String keyword);

    void updateViewCount(@Param("strategyId") Long strategyId);
}